<template>
	<view 
		class="my-search-container" 
		:style="{'background-color': bgcolor}"
		@click="searchBoxHandler"
	>
		<view 
			class="my-search-box" 
			:style="{'border-radius': radius + 'px'}"	
		>
			<uni-icons type="search" size="15"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		props: {
			// 背景颜色
			bgcolor: {
				type: String,
				default: '#c00000'
			},
			// 圆角尺寸
			radius: {
				type: Number,
				default: 15
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			searchBoxHandler() {
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss">
.my-search-container {
	// background-color: #c00000;
	height: 36px;
	padding: 0 10px;
	display: flex;
	align-items: center;
	.my-search-box {
		height: 28px;
		background-color: #FFFFFF;		// border-radius: 15px;
		width: 100%; 
		text-align: center;
		line-height: 28px;
	}
	text {
		font-size: 12px; 
		color: #999;
	}
}
</style>
